<?php
/**
 * User: b179a9
 * Date: 10/3/11
 * Time: 9:27 PM 
 */
 
class AdminController extends Zend_Controller_Action {

    /**
     * @var Lib_Flash
     */
    protected $_flashMessenger = null;

    public function init() {
         if ($this->_request->isXmlHttpRequest()) {
            $this->_helper->layout()->disableLayout();
        } else {
            $this->_helper->layout()->setLayout('admin-layout');
        }
        $this->_flashMessenger = new Lib_Flash();
    }

    public function indexAction() {
        
    }

    /**
     * Очищает кеш.
     * @return void
     */
    public function clearAction() {
        $manager = new \Managers\BaseManager();
        $manager->_getCacheManager()->clean();
        $this->_flashMessenger->addMessage('Cache cleaned.', Lib_Flash::NOTICE, Lib_Flash::PRE);
        $this->_redirect('/admin');
    }

}
